/**
 * @author zowie
 * @dete 2022-
 * @function 
 * @param {} 
 * @return {} 
 */


function alphabetPosition(text) {
  var result = [];
  var alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
    "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
    "w", "x", "y", "z"]
  text = text.replace(/\W*\d+/g, '').toLowerCase().split('');
  for (var i = 0; i < text.length; i++)
    if (alphabet.indexOf(text[i]) != -1) {
      result.push(alphabet.indexOf(text[i]) + 1);
    }
  return result.join(' ');
}

function alphabetPosition(text) {
  return text
    .toUpperCase()
    .match(/[a-z]/gi)
    .map((c) => c.charCodeAt() - 64)
    .join(' ');
}


function alphabetPosition(text) {
  var result = "";
  for (var i = 0; i < text.length; i++) {
    var code = text.toUpperCase().charCodeAt(i)
    if (code > 64 && code < 91) result += (code - 64) + " ";
  }

  return result.slice(0, result.length - 1);
}


function alphabetPosition(text) {
  var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
  return text.toLowerCase().split('')
    .filter(letter => {
      let index = alphabet.indexOf(letter);
      return index > -1;
    })
    .map(letter => alphabet.indexOf(letter) + 1)
    .join(' ')
}


function alphabetPosition(text) {
  return text.match(/[a-zA-Z]/g).map((el) => el.toLowerCase().charCodeAt() - 96).join(' ');
}


function alphabetPosition(text) {
  return text.toLowerCase().split('').map(a => a.charCodeAt(0) - 96).filter(a => a > 0 && a < 27).join(' ');
}



console.log(alphabetPosition("The sunset sets at twelve o' clock."));
